import axios from 'axios'
import qs from 'qs'

export function Aget(url , params={} ){
    return new Promise((resolve,rejects) =>{
        axios.get(url,{
            params:params
        })
        .then((res) =>{
            resolve(res.data)
        })
        .catch(err =>{
            rejects(err)
        })
    })
}

export function Apost(url , params={} ){
    return new Promise((resolve,rejects) =>{
        axios.post(url,qs.stringify(params))
        .then((res) =>{
            resolve(res.data)
        })
        .catch(err =>{
            rejects(err)
        })
    })
}